# coding: utf-8
'''
Created on 24 avr. 2011

@author: shin
'''
import unittest
from business.Personnage import Personnage
from stub.DaoElement import DaoElement

class Test(unittest.TestCase):

    def setUp(self):
        self.personnage = Personnage(DaoElement("Guerrier", "Nain"))

    def tearDown(self):
        del self.personnage
        
    def test_Init_Joueur(self):
        self.assertEqual(self.personnage.joueur, 1)

    def test_Init_Endurance(self):
        self.assertEqual(self.personnage.endurance, 7)
        
    def test_Init_Intelligence(self):
        self.assertEqual(self.personnage.intelligence, 7)

    def test_Init_Energie(self):
        self.assertEqual(self.personnage.energie, 100)

    def test_Init_Cible(self):
        self.assertEqual(self.personnage.cible, "")

    def test_Init_Competence(self):
        self.assertEqual(self.personnage.competence, {'Passe son tour':1,
                                                      'Frappe'        :1,
                                                      'Brise Genoux'  :1,
                                                      'Mouvement'     :1})
        
        
    def test_RecuperationEnergie(self):
        self.assertEqual(self.personnage.recuperationEnergie(), 14)

    def test_Mouvement(self):
        self.assertEqual(self.personnage.mouvement(), 3)

    def test_Initiative(self):
        self.assertEqual(self.personnage.initiative(), 6)
    

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()